package lekcja4.zad9;

public class C {
    private String imie;
    private int wiek;

    public C(int wiek){
        this.imie = null;
        this.wiek = wiek;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        C c = (C) o;

        if (wiek != c.wiek) return false;
        if (imie != null ? !imie.equals(c.imie) : c.imie != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = imie.hashCode();
        result = 31 * result + wiek;
        return result;
    }
}
